package com.echo.code.spring.tx;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

/**
 * Description
 *
 * @author baiyp
 * @version 1.0.0
 * @date 2019/04/21
 */
@Component
public class UserDao {

  @Autowired
  private JdbcTemplate jdbcTemplate;

  public void addUser(User user) {
    jdbcTemplate.execute("insert user (name, phone, address) values ('" + user.getName() + "', '" + user.getPhone() + "', '" + user.getAddress() + "')");
  }
}
